<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tjsinfo.tjsoa.common.ToolKit"%>
<%@page import="com.tjsinfo.tjsoa.common.SessionUser"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String treePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/RQOAtree/";
	String nowSQL = ToolKit.getProperties("com/tjsinfo/tjsoa/mail/properties/systemResource.properties", this).getProperty("nowSQL");
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	String nowtime = sdf.format(new Date()); 
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" id="txlz7"/>
		<style type="text/css">
			#fileUploadDiv a{
			background:url(../images/scicon.gif) no-repeat 0 0px;width:77px;height:22px;cursor: hand;margin-top:5px;margin-left:5px;
		</style>
		
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>

	<!-- 多系统树 开始 -->
	<link href="<%=treePath %>ajaxLibrary/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=treePath %>ajaxLibrary/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxLibrary/ext/ext-all.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxLibrary/ext/ext-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
	<script type="text/javascript" src="<%=treePath %>ajaxLibrary/ext/init.js"></script>
	<script type="text/javascript" src="<%=treePath %>js/system/userinfocheckedtree.js"></script>
	<script type="text/javascript">
		function peopleTree(){
			var win = userinfochecktree(<%=nowSQL %>,<%=SessionUser.getUserId(request) %>);
			win.show();
			win.on("winsubmint",function(data){
				document.getElementById('jieshourenName').value = data.usernametext;
				document.getElementById('jieshourenid').value = data.usertext;
				win.hide();
			});
		}
	</script>
	<!-- 结束 -->
	
	<script type="text/javascript">
		
		//判断收件人和内容是不是为空
		function submitform1(){
			if(isnull("input[name='jieshourenName']","接收人不能为空")
				&&isstringnull($("#info").text(),"发送内容不能为空"))
			{
				var bl = true;
				if(document.getElementById('uploadFile').value!=''){
					if(confirm("您附件中有未上传的文件，是否上传？")){
						bl = false;
						ajaxFileUpload();
					}
				}
				if(bl){
					if($("#info").text().length<400)
					{
						msg();
						document.form1.submit();
					}
					else
					{
						Ext.MessageBox.alert('提示信息', '输入内容长度不能超过400');
					}
				}
			}
				
		}
		window.onload = function(){
			var tb = new Ext.Toolbar(
				{
					height:25
				}
			);
		
			tb.add(
		    {
		            text:'确认',
		            iconCls: 'daohang',
		        	handler: function(){
		        		submitform1();
					}
		    },
		    {
		            text:'返回',
		            iconCls: 'daohang',
		        	handler: function(){
		        		history.go(-1);
					}
		    }
		    );
		    tb.render('menu');
			document.getElementById("right").style.height = document.body.clientHeight-60;
	    }
	</script>

	<!-- 执行上传文件操作的函数 start-->
	<script type="text/javascript">
	var deleteFile;
	var alreadyUploadFile='';
	var uploadUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=uploader';
	var deteleFileUrl='<%=basePath %>tjsinfo/tjsoa/system/ajaxFileUpload.do?method=deleted';
	</script>
	<!-- 执行上传文件操作的函数 end-->	
	</head>

	<body style="background:#D9E8F1;">
		<div id="right">
			<div id="menu" style="padding-top: 4px;"></div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				height="100%">
				<tr>
					<td valign="top" height="100%">
						<div class="contabwd" style="overflow-y: scroll">
							<form
								action="<%=basePath%>tjsinfo/tjsoa/messageImportant/insertMessage.do" name="form1" method="post">
								
								<table width="740" border="0" cellspacing="0" cellpadding="0" style="margin-left: 10px" class="bgypff">
									<tr>
										<td width="70px"> 
											接收人： 
										</td>
										<td>
											<input readonly="readonly" name="jieshourenName" type="text"
												size="50" id="jieshourenName"
												style="border: 1px #C0C0C0 solid; background: #F4F4F4; height: 19px" />
											<a href="javascript:peopleTree();" ><img
													src="<%=basePath%>images/icon100.gif" /></a>
											<input type="hidden" name="jieshourenid" id="jieshourenid" />
										</td>
									</tr>
									<tr>
										<td>
											发送内容：
										</td>
										<td>
											<textarea rows="18" cols="80" name="info" id="info"></textarea>
										</td>
									</tr>
									<tr>
										<td>
											发送时间：
										</td>
										<td>
        									<input name="sendTime" id="sendTime" type="text" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" value="<%=nowtime %>"/>
										</td>
									</tr>
									<tr>
										<td>
											<img src="<%=basePath %>images/m_icon212.gif" width="67" height="21" />
										</td>
										<td>
                							<span><input type="file" UNSELECTABLE="on"  name="uploadFile" id="uploadFile" size="34" class="textinput" />&nbsp;<a style="cursor: hand" onclick="ajaxFileUpload()"><img src="<%=basePath %>images/scicon.gif" /></a></span>
                							<div class="sc_listLong"><ul id="uploadList"></ul></div>
										</td>
									</tr>
								</table>
								<input  type="hidden" name="node" id="node"/>
								 <input id="basePath" value="<%=basePath%>" type="hidden"/>
            					<div id="files" style="display: none;"></div>
							</form>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</body>
</html>
